package com.xc.hotelmgr.webapi.modules.ht.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xc.hotelmgr.webapi.common.utils.PageUtils;
import com.xc.hotelmgr.webapi.common.utils.Query;

import com.xc.hotelmgr.webapi.modules.ht.dao.HtPhysicalRoomDao;
import com.xc.hotelmgr.webapi.modules.ht.entity.HtPhysicalRoomEntity;
import com.xc.hotelmgr.webapi.modules.ht.service.HtPhysicalRoomService;


@Service("htPhysicalRoomService")
public class HtPhysicalRoomServiceImpl extends ServiceImpl<HtPhysicalRoomDao, HtPhysicalRoomEntity> implements HtPhysicalRoomService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Object hotelCode = params.get("hotelCode");
        IPage<HtPhysicalRoomEntity> page = this.page(
                new Query<HtPhysicalRoomEntity>().getPage(params),
                new QueryWrapper<HtPhysicalRoomEntity>().eq(hotelCode !=null,"hotel_code",hotelCode)
        );

        return new PageUtils(page);
    }

}